﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection.Emit;

namespace SscLib
{
    /// <summary>
    /// Defines a Label symbol.
    /// </summary>
    public class LabelSymbol : Symbol
    {
        /// <summary>Reflection.Emit label instance for this Label symbol.</summary>
        private Label label;

        public Label Label
        {
            get { return this.label; }
            set { this.label = value; this.Defined = true; }
        }

        public bool Defined;

        /// <summary>
        /// Creates a new Label symbol with name.
        /// Labels do not have a type. (yet =)
        /// </summary>
        /// <param name="name">Label name.</param>
        //Todo: verify that Labels do not have a type definition.
        public LabelSymbol(string name)
            : base(name, null)
        {
        }
        
        /// <summary>
        /// Creates a new Label symbol with name, the label instance
        /// Labels do not have a type. (yet =)
        /// </summary>
        /// <param name="name">Label name.</param>
        /// <param name="label">The Reflection.Emit.Label instance.</param>
        //Todo: verify that Labels do not have a type definition.
        public LabelSymbol(string name, Label label)
            : base(name, null)
        {
            this.Label = label;
        }
    }
}
